package home.projects.misc;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class GenericListTest {

   public static void main(String[] args) {
      System.out.println(args[-12]);
   }

}

class MyList<E> extends ArrayList<E> {

   private static final long serialVersionUID = 1L;

   /*
    * (non-Javadoc)
    * 
    * @see java.util.AbstractList#iterator()
    */
   public Iterator<E> iterator() {
      return new MyIterator();
   }

   private final class MyIterator implements Iterator<E> {

      private Iterator<E> superIter;

      public MyIterator() {
         this.superIter = MyList.this.iterator();
      }

      public boolean hasNext() {
         return superIter.hasNext();
      }

      public E next() {
         return superIter.next();
      }

      public void remove() {
         superIter.remove();
      }

   }

}

class YourClass {
   
   private static final List<String> LOWER_CASE_CHARS;
   
   private static final List<String> UPPER_CASE_CHARS;
   
   static {
      LOWER_CASE_CHARS = listFromArray("abcdefgh".toCharArray());
      UPPER_CASE_CHARS = listFromArray("ABCDEFGH".toCharArray());
   }
   
   private static List<String> listFromArray(char[] charArray) {
      List<String> list = new ArrayList<String>(charArray.length);
      for(char ch : charArray) {
         list.add(String.valueOf(ch));
      }
      return list;
   }
   
   public String[] fillResultArray() {
      boolean checkBoxOneChecked = false, checkBoxTwoChecked = false;
      List<String> stringList = new ArrayList<String>();
      if(checkBoxOneChecked) {
         stringList.addAll(LOWER_CASE_CHARS);
      }
      if(checkBoxTwoChecked) {
         stringList.addAll(UPPER_CASE_CHARS);
      }
      return stringList.toArray(new String[] {});
   }
   
}
